const { Sequelize, DataTypes, QueryTypes } = require('sequelize');

class CreateSequelize {
    constructor() {
        this.db = null
    }
    init_sequeleze() {
        // this.db = new Sequelize('wechat（仓库名称）', 'root（用户名称）', 'mysql（mysql仓库密码）', {
        //     host: 'localhost',
        //     dialect: 'mysql'
        // });
        this.db = new Sequelize('wechat', 'root', 'woaini.1.2', {
            host: 'localhost',
            dialect: 'mysql'
        });
        this.db.sync({ force: false })
    }
    select(sql, params) {
        return this.db.query(sql, { type: QueryTypes.SELECT });
    }
    select(sql, params) {
        return this.db.query(sql, {
            type: QueryTypes.SELECT
        });
    }
}
module.exports = CreateSequelize